package com.tangcco.lockwell.test;

import java.util.List;
import java.util.Objects;


// 使用JPA规范将Material类映射到数据库表，若不需要持久化可去掉Entity等相关注解

public class Material {


    // 对应JSON中每个"materials"元素里的"type"字段，用于区分不同类型的资料素材
    private Integer type;
    // 这里使用Object类型来存储不同type对应的具体内容，相对更灵活些，实际项目中可根据具体需求进一步细分不同子类的属性等，
    // 比如针对不同type创建不同的实体类继承自Material类并定义各自特有的属性
    private List<Content> content;
    private List<Question> questions;

    // 默认构造函数，供框架使用等情况
    public Material() {
    }

    public Material(Integer type, List<Content> content) {
        this.type = type;
        this.content = content;
    }

    public Material(Integer type, List<Content> content, List<Question> questions) {
        this.type = type;
        this.content = content;
        this.questions = questions;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public List<Content> getContent() {
        return content;
    }

    public void setContent(List<Content> content) {
        this.content = content;
    }

    public List<Question> getQuestions() {
        return questions;
    }

    public void setQuestions(List<Question> questions) {
        this.questions = questions;
    }

    @Override
    public String toString() {
        return "Material{" +
                "type=" + type +
                ", content=" + content +
                ", questions=" + questions +
                '}';
    }

}